package com.zero;

public class Main {

    public static void main(String[] args) {
	// write your code here
        /**
         * 运算符
         * 算数运算符
         * 关系运算符
         * 逻辑运算符
         * 赋值运算符
         * 位运算符
         */
        int a = 10;
        int b = 20;
        int c = 25;
        int d = 25;
        //算数运算
        System.out.println("a + b = " + (a + b) );
        System.out.println("a - b = " + (a - b) );
        System.out.println("a * b = " + (a * b) );
        System.out.println("b / a = " + (b / a) );
        System.out.println("b % a = " + (b % a) );
        System.out.println("c % a = " + (c % a) );
        System.out.println("a++   = " +  (a++) );
        System.out.println("a--   = " +  (a--) );
        System.out.println("d++   = " +  (d++) );
        System.out.println("++d   = " +  (++d) );

        //关系运算符
        System.out.println(" == b = " + (a == b) );
        System.out.println("a != b = " + (a != b) );
        System.out.println("a > b = " + (a > b) );
        System.out.println("a < b = " + (a < b) );
        System.out.println("b >= a = " + (b >= a) );
        System.out.println("b <= a = " + (b <= a) );

        //逻辑运算符
        System.out.println(a < b & a<c);
        System.out.println(a > b && a<c);//短路逻辑与（&&）
        System.out.println(a < b || a>c);
        System.out.println(a != b);

        //赋值运算符
        int e = 0;
        e += d;
        System.out.println(e);
        e -= b;
        System.out.println(e);
        e *= a;
        System.out.println(e);
        e /= a;
        System.out.println(e);
        e %= a;
        System.out.println(e);

        int f = 20;
        f >>= 2;
        System.out.println(f);
        f <<= 2;
        System.out.println(f);
        int g = 2;
        g &= 2;
        System.out.println(g);


    }
}
